<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:113:"/mnt/client2023/d-crmqing.bigchun.com/fastcrm/public/../application/admin/view/facrm/setting/payonline/index.html";i:1676906865;s:88:"/mnt/client2023/d-crmqing.bigchun.com/fastcrm/application/admin/view/layout/default.html";i:1676906865;s:85:"/mnt/client2023/d-crmqing.bigchun.com/fastcrm/application/admin/view/common/meta.html";i:1676906865;s:87:"/mnt/client2023/d-crmqing.bigchun.com/fastcrm/application/admin/view/common/script.html";i:1676906865;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">
<meta name="referrer" content="never">
<meta name="robots" content="noindex, nofollow">

<link rel="shortcut icon" href="/assets/img/favicon.ico" />
<!-- Loading Bootstrap -->
<link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">

<?php if(\think\Config::get('fastadmin.adminskin')): ?>
<link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
<?php endif; ?>

<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="/assets/js/html5shiv.js"></script>
  <script src="/assets/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
    var require = {
        config:  <?php echo json_encode($config); ?>
    };
</script>

    </head>

    <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
        <div id="main" role="main">
            <div class="tab-content tab-addtabs">
                <div id="content">
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <section class="content-header hide">
                                <h1>
                                    <?php echo __('Dashboard'); ?>
                                    <small><?php echo __('Control panel'); ?></small>
                                </h1>
                            </section>
                            <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
                            <!-- RIBBON -->
                            <div id="ribbon">
                                <ol class="breadcrumb pull-left">
                                    <?php if($auth->check('dashboard')): ?>
                                    <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
                                    <?php endif; ?>
                                </ol>
                                <ol class="breadcrumb pull-right">
                                    <?php foreach($breadcrumb as $vo): ?>
                                    <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
                                    <?php endforeach; ?>
                                </ol>
                            </div>
                            <!-- END RIBBON -->
                            <?php endif; ?>
                            <div class="content">
                                <?php 

$epayinfo = get_addon_info('epay');

 if((!$epayinfo || !$epayinfo['state'])): ?>
<div class="alert alert-danger-light ">
    <p><i class="fa fa-info"></i> <?php echo __('开通合同支付需要安装“微信支付宝”插件'); ?></p>
</div>
<?php endif; ?>
<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <div class="panel-lead"><em>合同在线支付、续费</em></div>
        <?php echo build_heading(null,FALSE); ?>
    </div>
    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
                        <input id="c-key" type="hidden" data-rule="required"  class="form-control" name="row[key]" value="<?php echo $key; ?>" readonly/>
                        <div class="row">

                            <div class="col-md-12 col-xs-12 form-group">
                                <label for="c-wechat_id" class="control-label col-xs-12 col-sm-2"><?php echo __('微信支付关联收款账户'); ?>:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <?php echo build_select("row[values][weixin_id]", $account_list,isset($row['values']['weixin_id'])?$row['values']['weixin_id']:1, ['class'=>'form-control selectpicker', 'data-rule'=>'required']); ?>
                                </div>
                            </div>
                            <div class="col-md-12 col-xs-12 form-group">
                                <label for="c-alipay_id" class="control-label col-xs-12 col-sm-2"><?php echo __('支付宝关联收款账户'); ?>:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <?php echo build_select("row[values][alipay_id]", $account_list,isset($row['values']['alipay_id'])?$row['values']['alipay_id']:1, ['class'=>'form-control selectpicker', 'data-rule'=>'required']); ?>

                                </div>
                            </div>

                            <div class="col-md-12 col-xs-12 form-group">
                                <label for="c-online_pay" class="control-label col-xs-12 col-sm-2"><?php echo __('启用在线收款'); ?>:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <?php echo build_radios('row[values][online_pay]', ['1'=>__('开启'), '0'=>__('关闭')], isset($row['values']['online_pay'])?$row['values']['online_pay']:0); ?>

                                </div>
                            </div>
                            <div class="col-md-12 col-xs-12 form-group">
                                <label for="c-renew_pay" class="control-label col-xs-12 col-sm-2"><?php echo __('启用续费合同'); ?>:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <?php echo build_radios('row[values][renew_pay]', ['1'=>__('开启'), '0'=>__('关闭')], isset($row['values']['renew_pay'])?$row['values']['renew_pay']:0); ?>

                                </div>
                            </div>
                            <div class="col-md-12 col-xs-12 form-group">
                                <label for="c-renew_pay" class="control-label col-xs-12 col-sm-2"><?php echo __('续费日期处理方式'); ?>:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <?php echo build_radios('row[values][renew_type]', ['1'=>__('合同结束时间累加'), '0'=>__('支付成功时间累加')], isset($row['values']['renew_type'])?$row['values']['renew_type']:0); ?>
                                    <span class="help-block">*合同过期一段时间了，是按照过期时间续期还是，当前支付成功时间续期。</span>
                                </div>
                            </div>

                            <div class="col-md-12 col-xs-12 form-group">
                                <label for="c-renew_day" class="control-label col-xs-12 col-sm-2"><?php echo __('可提前续费天数'); ?>:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-renew_day" class="form-control" name="row[values][renew_day]"  type="number" value="<?php echo isset($row['values']['renew_day'])?$row['values']['renew_day']:30; ?>">
                                    <span class="help-block">*合同过期前多少天才能续费。</span>
                                </div>
                            </div>
                            <div class="col-md-12 col-xs-12 form-group">
                                <label for="c-renew_max" class="control-label col-xs-12 col-sm-2"><?php echo __('最多可续费数量'); ?>:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-renew_max" class="form-control" name="row[values][renew_max]"  type="number" value="<?php echo isset($row['values']['renew_max'])?$row['values']['renew_max']:1; ?>">
                                    <span class="help-block">可理解为续费的时候最多下单数量</span>
                                </div>
                            </div>
                            <div class="col-md-12 col-xs-12 form-group">
                                <label for="c-renew_day" class="control-label col-xs-12 col-sm-2"><?php echo __('续费单位'); ?>:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <select class=" form-control" name="row[values][renew_unit]" >

                                        <option value="year" <?php if(isset($row["values"]['renew_unit'])&&$row["values"]['renew_unit']=='year'): ?> selected <?php endif; ?>>年</option>
                                        <option value="month" <?php if(isset($row["values"]['renew_unit'])&&$row["values"]['renew_unit']=='month'): ?> selected <?php endif; ?>>月</option>
                                        <option value="day" <?php if(isset($row["values"]['renew_unit'])&&$row["values"]['renew_unit']=='day'): ?> selected <?php endif; ?>>日</option>

                                    </select>
                                </div>
                            </div>

                            <div class="col-md-12 col-xs-12 form-group">
                                <label for="c-renew_percentage" class="control-label col-xs-12 col-sm-2"><?php echo __('续费价格'); ?>:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-renew_percentage" class="form-control" name="row[values][renew_percentage]"  type="number" value="<?php echo isset($row['values']['renew_percentage'])?$row['values']['renew_percentage']:100; ?>">
                                    <span class="help-block">合同的总额百分比,合同可单独设价格</span>
                                </div>
                            </div>



                            <div class="form-group col-md-12 col-xs-12">
                                <label for="c-agreement" class="control-label col-xs-12 col-sm-2"><?php echo __('收款协议'); ?>:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <textarea id="c-agreement" data-rule="required" class="form-control editor " name="row[values][agreement]" rows="5"><?php echo isset($row['values']['agreement'])?$row['values']['agreement']:''; ?></textarea>
                                    <span class="help-block">*支持插入回款单字段，如回款单号{:number}。</span>
                                </div>
                            </div>


                            <div class="form-group col-md-12 col-xs-12">
                                <label for="c-r_agreement" class="control-label col-xs-12 col-sm-2"><?php echo __('合同续费协议'); ?>:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <textarea id="c-r_agreement" data-rule="required" class="form-control editor " name="row[values][r_agreement]" rows="5"><?php echo isset($row['values']['r_agreement'])?$row['values']['r_agreement']:''; ?></textarea>
                                    <span class="help-block">*支持插入合同字段，如合同单号{:number}。</span>
                                </div>
                            </div>

                            <div class="form-group layer-footer">
                                <label class="control-label col-xs-12 col-sm-2"></label>
                                <div class="col-xs-12 col-sm-8">
                                    <button type="submit" class="btn btn-success btn-embossed disabled"><?php echo __('submit'); ?></button>
                                    <button type="reset" class="btn btn-default btn-embossed"><?php echo __('Reset'); ?></button>
                                </div>
                            </div>
                    </form>



                </div>
            </div>

        </div>
    </div>
</div>

<script>
    require.callback = function () {

        define('backend/facrm/setting/payonline', ['jquery', 'form'], function ($, Form) {
            var Controller = {
                index: function () {
                    Form.api.bindevent($("form[role=form]"));

                }
            };
            return Controller;
        });
    }
</script>





                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
    </body>
</html>
